// 封装本地储存模块
export const getItem = function(name){
  const data = window.localStorage.getItem(name)
  try{
    return JSON.parse(data)
  }catch(e){
    return data
  }
}
export const setItem = function(name,value){
  if(typeof value === 'object'){
    value = JSON.stringify(value)
  }
  window.localStorage.setItem(name, value)
}
export const removeItem = function(name){
  window.localStorage.removeItem(name)
}